package com.xbongbong.pro.workreportset.pojo.dto;

import com.xbongbong.paas.domain.entity.ext.OptionalRangeEntity;
import com.xbongbong.paas.pojo.StatisticOptionPojo;
import com.xbongbong.paas.toolbox.wrap.BaseDTO;
import com.xbongbong.pro.workreportset.pojo.WorkReportSetUserCcPojo;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @author youli.chen
 * @ProjectName xbb-pro
 * @Description: TODO
 * @date 2019/1/17 10:40
 */
@Setter
@Getter
@ToString
public class WorkReportSetSaveDTO extends BaseDTO {

    /**
     * 自增主键
     */
    @NotNull(message = "{dto.msg.workReportSetSave.id.NotNull}")
    private Long id;

    /**
     * 类型 1日报2周报3月报
     */
    @NotNull(message="{dto.msg.workReportSetSave.workReportType.NotNull}")
    @Range(min = 1, max = 3, message="{dto.msg.workReportSetSave.workReportType.Range}")
    private Integer workReportType;

    /**
     * 是否启用 0否 1是
     */
    @DecimalMin(value = "0", message = "{dto.msg.workReportSetSave.enable.DecimalMin}")
    @DecimalMax(value = "1", message = "{dto.msg.workReportSetSave.enable.DecimalMax}")
    private Integer enable;

    /**
     * 可见范围,角色，部门，员工的json
     */
    private List<OptionalRangeEntity> visibleObject;
    /**
     * 固定抄送人[{"effectiveDeps":[], "users":[]}]
     */
    private List<WorkReportSetUserCcPojo> ccUserApprovedPeople;

    /**
     * 统计维度json
     */
    private StatisticOptionPojo statisticOption;

    /**
     * 截止时间选项 1当日,2次日；1本周五，2本周六，3本周日，4下周一；1次月第一天，2当月最后一天
     */
    private Integer deadlineOption;

    /**
     * 截止时间 9:00
     */
    @Length(max = 10, message = "{dto.msg.workReportSetSave.deadlineTime.Length}")
    private String deadlineTime;

    /**
     * 是否允许补发 0不允许，1允许
     */
    @DecimalMin(value = "0", message = "{dto.msg.workReportSetSave.reissue.DecimalMin}")
    @DecimalMax(value = "1", message = "{dto.msg.workReportSetSave.reissue.DecimalMax}")
    private Integer reissue;

    /**
     * 补发时间限制 0无限制 其他为限制的天数
     */
    private Integer reissueTimeLimit = 0;

    /**
     * 编辑时间限制，-1不限制
     */
    private Integer editTimeLimit;

    /**
     * 最近修改人userId
     */
    @Length(max = 50, message = "{dto.msg.workReportSetSave.modifyUserId.Length}")
    private String modifyUserId;

    /**
     * 创建人userId
     */
    @Length(max = 50, message = "{dto.msg.workReportSetSave.creatorUserId.Length}")
    private String creatorUserId;
}
